package com.yanqu.road.server.cmd.player;

import com.yanqu.road.entity.enums.eGamePlayerEventType;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.common.CommonProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_PLAYER_GO_YOU_XI_QUAN, desc = "前往游戏圈")
public class GoYouXiQuanCmd extends AbstractCommand {
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        player.notifyListener(eGamePlayerEventType.GoYouXiQuan.getValue(), 1);
        player.notifyListener(eGamePlayerEventType.GoYouXiQuan7Day.getValue(), 1);
        player.notifyListener(eGamePlayerEventType.GoYouXiQuanActivity.getValue(), 1);
    }

    @Override
    public void sendData(GamePlayer player) {
        CommonProto.ResultValueMsg.Builder respMsg = CommonProto.ResultValueMsg.newBuilder();
        respMsg.setRet(ret);
        player.sendPacket(Protocol.U_PLAYER_GO_YOU_XI_QUAN, respMsg);
    }
}
